﻿using System.Windows.Controls;
using System.Windows.Threading;

namespace WpfAppMissData.Extensions
{
    public static class WpfTextBlockExtensions
    {  
        public static void SetTextThreadSafe(this TextBlock textBlock, string s)
        {
           
           textBlock.InvokeIfRequired(() => { textBlock.Text = s; }, DispatcherPriority.Background);
           
            //WpfThreadingExtensions.InvokeIfRequired(textBlock, () => { textBlock.Text = s; }, DispatcherPriority.Background);
        }      
    }
}
